package jmine.tec.web.wicket;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum WebWicketMessages implements MessageCreator {
    FORM_LABEL_TITLE(1, "jmine.tec.web.wicket.form.label.title"),

    BUTTON_EXECUTION_SUCCESS_SINGLE(0, "jmine.tec.web.wicket.button.execution.success.single"),

    FORM_ERROR_CANNOT_FIND_ENTITY_TO_DELETE(2, "jmine.tec.web.wicket.form.error.cannot.find.entity.to.delete"),

    PAGES_MAIN_LOGIN_DENIED(0, "jmine.tec.web.wicket.pages.main.login.denied"),

    BUTTON_EXECUTION_ERROR_NOENTITYSELECTED(0, "jmine.tec.web.wicket.button.execution.error.noentityselected"),

    CRONEXPRESSION_TYPE_FIXED_SCHEDULE(0, "jmine.tec.web.wicket.cronexpression.type.fixed.schedule"),

    BUTTON_SEARCH(0, "jmine.tec.web.wicket.button.search"),

    CRONEXPRESSION_TYPE_PERIODIC(0, "jmine.tec.web.wicket.cronexpression.type.periodic"),

    FORM_ERROR_CANNOT_FIND_ENTITY_TO_VIEW(2, "jmine.tec.web.wicket.form.error.cannot.find.entity.to.view"),

    COMPONENT_LOGININFO_DATE_PATTERN(0, "jmine.tec.web.wicket.component.logininfo.date.pattern"),

    COMPONENT_LOGININFO_LAST_ACCESS(1, "jmine.tec.web.wicket.component.logininfo.last.access"),

    BUTTON_EXECUTION_ERROR_MULTIPLE(1, "jmine.tec.web.wicket.button.execution.error.multiple"),

    BUTTON_NEW(0, "jmine.tec.web.wicket.button.new"),

    CRONEXPRESSION_OPTIONAL_COMPONENTS_WEEKDAYS(0, "jmine-tec.web.wicket.cronexpression.optional.components.weekdays"),

    BUTTON_BACK(0, "jmine.tec.web.wicket.button.back"),

    BUTTON_SAVE(0, "jmine.tec.web.wicket.button.save"),

    FORM_INFO_ENTITY_DELETE_SUCCESS(0, "jmine.tec.web.wicket.form.info.entity.delete.success"),

    FORM_ERROR_CANNOT_FIND_ENTITY_TO_EDIT(2, "jmine.tec.web.wicket.form.error.cannot.find.entity.to.edit"),

    COMPONENT_LOGININFO_FIRST_ACCESS(0, "jmine.tec.web.wicket.component.logininfo.first.access"),

    BUTTON_EXECUTION_ERROR_SINGLE(0, "jmine.tec.web.wicket.button.execution.error.single"),

    CRONEXPRESSION_OPTIONAL_COMPONENTS_MONTHS(0, "jmine-tec.web.wicket.cronexpression.optional.components.months"),

    FORM_INFO_ENTITY_SAVE_SUCCESS(0, "jmine.tec.web.wicket.form.info.entity.save.success"),

    FORM_LABEL_SEARCH_TITLE(1, "jmine.tec.web.wicket.form.label.search.title"),

    FORM_LABEL_SEARCH_RESULT(0, "jmine.tec.web.wicket.form.label.search.result"),

    CRONEXPRESSION_OPTIONAL_COMPONENTS_DAYS(0, "jmine-tec.web.wicket.cronexpression.optional.components.days"),

    BUTTON_EXECUTION_SUCCESS_MULTIPLE(1, "jmine.tec.web.wicket.button.execution.success.multiple"),

    DATE_SPAN_IN_DAYS_GREATER_THAN_EXPECTED(4, "jmine.tec.web.wicket.date.span.in.days.grater.than.expected"),

    DATE_FIELD_GREATER_THAN_COMPARISON(4, "jmine.tec.web.wicket.date.field.greater.than.comparison"),

    DATE_FIELD_SMALLER_THAN_COMPARISON(4, "jmine.tec.web.wicket.date.field.smaller.than.comparison"),

    FORM_LABEL_END_DATE(0, "jmine.tec.web.wicket.end.date"),

    FORM_LABEL_START_DATE(0, "jmine.tec.web.wicket.start.date"),
    
    VALIDATOR_FORM_COMPONENT_NEEDED_ATTACH_ERROR(0, "jmine.tec.web.wicket.pages.validator.form.component.needed.attach.error"),  
    
    FORM_COMPONENT_IS_REQUIRED(1, "jmine.tec.web.wicket.pages.validator.form.component.is.required");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private WebWicketMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("jmine-tec-web-wicket-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
